<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/manage/common/taglibs.jsp" %>
<c:if test="${initParam['ssoEnable']=='true'}">
    <%@ include file="/WEB-INF/jsp/manage/common/ssoInclude.jsp" %>
</c:if>
<script type="text/javascript">
    $(function () {
        $.acooly.framework.registerKeydown('manage_trade_searchform', 'manage_trade_datagrid');
    });

</script>
<div class="easyui-layout" data-options="fit : true,border : false">
    <!-- 查询条件 -->
    <div data-options="region:'north',border:false" style="padding:5px; overflow: hidden;" align="left">
        <form id="manage_trade_searchform" onsubmit="return false">
            <table class="tableForm" width="100%">
                <tr>
                    <td align="left">
                        <div>
                            外部订单订单号: <input type="text" class="text" size="15" name="outOrderNo"/>
                            交易号: <input type="text" class="text" size="15" name="tradeNo"/>
                            <c:if test="${merchantTag != 'agentTrade' && merchantTag != 'normalTrade'}">
                                代理商ID号: <input type="text" class="text" size="15" name="agentId"/>
                                商户ID号: <input type="text" class="text" size="15" name="merchantId"/>
                            </c:if>
                            <c:if test="${merchantTag == 'agentTrade'}">
                                代理商ID号: <input type="text" class="text" size="15" name="agentId" value="${agentMerchant.merchantId}" hidden/>
                            </c:if>
                            <c:if test="${merchantTag == 'normalTrade'}">
                                商户ID号: <input type="text" class="text" size="15" name="merchantId" value="${normalMerchant.merchantId}" hidden/>
                            </c:if>
                            交易状态:
                            <select name="tradeStatus" id="search_LIKE_tradeStatus" editable="false" style="height:27px;" panelHeight="auto" class="easyui-combobox">
                                <c:forEach items="${tradeStatusList}" var="e">
                                    <option value="${e.key}">${e.value}</option>
                                </c:forEach>
                            </select>
                            <br>
                            开始时间: <input size="15" class="text" id="search_GTE_createTime" name="startTime"
                                         onFocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd'})"/>
                            至<input size="15" class="text" id="search_LTE_createTime" name="endTime"
                                    onFocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd'})"/>
                               <a href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:false"
                                  onclick="$.acooly.framework.search('manage_trade_searchform','manage_trade_datagrid');"><i
                                    class="fa fa-search fa-lg fa-fw fa-col"></i>查询</a>
                        </div>
                    </td>
                </tr>
            </table>
        </form>
    </div>

    <!-- 列表和工具栏 -->
    <div data-options="region:'center',border:false">
        <table id="manage_trade_datagrid" class="easyui-datagrid"
               url="${pageContext.request.contextPath}/manage/trade/trade/listJson.html" toolbar="#manage_trade_toolbar"
               fit="true" border="false" fitColumns="false"
               pagination="true" idField="id" pageSize="20" pageList="[ 10, 20, 30, 40, 50 ]" sortName="id"
               sortOrder="desc" checkOnSelect="true" selectOnCheck="true" singleSelect="true">
            <thead>
            <tr>
                <th field="showCheckboxWithId" checkbox="true"
                    data-options="formatter:function(value, row, index){ return row.id }">编号
                </th>
                <th field="id" sum="true">id</th>
                <th field="outOrderNo">外部订单订单号</th>
                <th field="tradeNo">交易号</th>
                <th field="agentId">代理商ID号</th>
                <th field="merchantId">商户ID号</th>
                <th field="tradeStatus">交易状态</th>
                <th field="createTime" formatter="formatDate">开始时间</th>
                <th field="updateTime" formatter="formatDate">结束时间</th>
                <th field="rowActions"
                    data-options="formatter:function(value, row, index){return formatAction('manage_trade_action',value,row)}">
                    动作
                </th>
            </tr>
            </thead>
        </table>

        <!-- 每行的Action动作模板 -->
        <div id="manage_trade_action" style="display: none;">
            <a onclick="$.acooly.framework.show('/manage/trade/trade/show.html?id={0}',500,400);" href="#" title="查看"><i
                    class="fa fa-file-o fa-lg fa-fw fa-col"></i></a>
        </div>

        <!-- 表格的工具栏 -->
        <div id="manage_trade_toolbar">
            <a href="#" class="easyui-menubutton" data-options="menu:'#manage_trade_exports_menu'"><i
                    class="fa fa-arrow-circle-o-down fa-lg fa-fw fa-col"></i>批量导出</a>
            <div id="manage_trade_exports_menu" style="width:150px;">
                <div onclick="$.acooly.framework.exports('/manage/trade/trade/exportXls.html','manage_trade_searchform','trade')">
                    <i class="fa fa-file-excel-o fa-lg fa-fw fa-col"></i>Excel
                </div>
                <div onclick="$.acooly.framework.exports('/manage/trade/trade/exportCsv.html','manage_trade_searchform','trade')">
                    <i class="fa fa-file-text-o fa-lg fa-fw fa-col"></i>CSV
                </div>
            </div>
        </div>
    </div>

</div>
